Add Event Indexing Guide and social_feed example#80
Open
deranalabs wants to merge 3 commits intocedra-labs:mainfrom
Open
Add Event Indexing Guide and social_feed example#80deranalabs wants to merge 3 commits intocedra-labs:mainfrom
deranalabs wants to merge 3 commits intocedra-labs:mainfrom
Conversation
This document outlines the Event Indexing pattern for building gas-efficient social feeds on Cedra, addressing state bloat and gas costs, and providing a code walkthrough for implementing the solution.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Cedra Builders Forge - Submission
Season 1
📋 Task Information
Task Title: Event Indexing Guide (Issue #63)
Issue Link: #63
Telegram: @deranaz
✅ Checklist
📝 What Was Built
I built a complete Event Indexing Guide and an example Move Package that demonstrates how to implement gas-efficient social feeds on Cedra using events instead of on-chain vectors.
Key Features:
README.mdexplains the problem of state bloat and introduces the "Events as Storage" pattern.cedra_guide::social_feedthat emitsPostEventinstead of storing posts in global state.Technical Approach:
I created a minimal Move package
CedraEventGuidewith aUserEventsresource holding anEventHandle<PostEvent>per user. Thepostentry function only emits events and never appends to an on-chain vector, keeping gas usage low and state small.🧪 Testing
Setup:
How to Test:
aptos move test --skip-fetch-latest-git-deps📚 Documentation
🎯 Quality Check
I confirm my submission:
📸 Demo (Optional)
I have read and agree to follow all Cedra Builders Forge rules.
Closes #63